package com.produce.user.entity;

import com.common.dao.base.entity.QueryBase;
import com.produce.user.util.UuidGenId;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

/**
 * 类描述：菜单实体
 *
 * @author linzf
 */
@Table(name = "t_tree")
public class RoleTree extends QueryBase {

    /**
     * 菜单唯一标识
     */
    @Id
    @Column(name = "treeId")
    @KeySql(genId = UuidGenId.class)
    private String treeId;
    /**
     * 菜单名字
     */
    @Column(name = "name")
    private String name;
    /**
     * 菜单地址
     */
    @Column(name = "url")
    private String url;
    /**
     * 菜单编码
     */
    @Column(name = "code")
    private String code;
    /**
     * 菜单状态【1：可用；2：禁用】
     */
    @Column(name = "state", updatable = false)
    private String state;
    /**
     * 菜单类型【1：菜单节点；2：按钮节点】
     */
    @Column(name = "type")
    private String type;
    /**
     * 父节点唯一标识
     */
    @Column(name = "parentTreeId", updatable = false)
    private String parentTreeId;
    /**
     * 父节点名字
     */
    @Column(name = "parentTreeName", updatable = false)
    private String parentTreeName;
    /**
     * 创建时间
     */
    @Column(name = "crtDate", updatable = false)
    private Long crtDate;
    /**
     * 创建人唯一标识
     */
    @Column(name = "crtUserId", updatable = false)
    private String crtUserId;
    /**
     * 创建人
     */
    @Column(name = "crtUser", updatable = false)
    private String crtUser;

    /**
     * 子菜单节点
     */
    @Transient
    private List<RoleTree> children;

    public List<RoleTree> getChildren() {
        return children;
    }

    public void setChildren(List<RoleTree> children) {
        this.children = children;
    }

    public String getTreeId() {
        return treeId;
    }

    public void setTreeId(String treeId) {
        this.treeId = treeId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getParentTreeId() {
        return parentTreeId;
    }

    public void setParentTreeId(String parentTreeId) {
        this.parentTreeId = parentTreeId;
    }

    public String getParentTreeName() {
        return parentTreeName;
    }

    public void setParentTreeName(String parentTreeName) {
        this.parentTreeName = parentTreeName;
    }

    public Long getCrtDate() {
        return crtDate;
    }

    public void setCrtDate(Long crtDate) {
        this.crtDate = crtDate;
    }

    public String getCrtUserId() {
        return crtUserId;
    }

    public void setCrtUserId(String crtUserId) {
        this.crtUserId = crtUserId;
    }

    public String getCrtUser() {
        return crtUser;
    }

    public void setCrtUser(String crtUser) {
        this.crtUser = crtUser;
    }
}
